home *** CD-ROM | disk | FTP | other *** search
- Path: cs.city.ac.uk!usenet
- From: h <Lone@Ranger.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Beginer C please help me
- Date: Tue, 26 Mar 1996 19:24:01 +0000
- Organization: DiM (Damsell in Distress)
- Message-ID: <31584451.4A56@Ranger.uk>
- References: <DoLCFx.B7x.0.bloor@torfree.net> <4iq6uc$evq@daryl.scsn.net> <4irjqa$jtn@winx03.informatik.uni-wuerzburg.de>
- NNTP-Posting-Host: causeland.city.ac.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; SunOS 5.3 sun4m)
-
- Jochen Schoof wrote:
- >
- > Scott Shrader (shrader@scsn.net) wrote:
- > : In article <DoLCFx.B7x.0.bloor@torfree.net>, bz786@torfree.net says...
- > : >
- > : >This may be a stupid mistake but "please help" me.
- > : >Thank you very much.
- > : >
- > : >#include <stdio.h>
- > : >#include <math.h>
- > : >main ()
- > : >{
- > : >float n;
- > : >n=(9/5);
- ^^^
-
- use 9.0 / 5.0 instead...
-
-
-
- > : >printf ("n= %1.3f\n", n);
- > : >}
- > : >I have complied and run the programme & I got the answer n=1.000
- > : >but Iam supposed to get answer 1.8.
- > : >Why I got this answer?
- > : >--
- > : you can write this by skipping printf("n= %1.3f\n", n); and put in
- > : printf("%f",n);
- > :
- > : Try this to see how this works.
- >
- > What you wrote is complete nonsense. How about testing the programs
- > before posting them..? Even learning C might be of help.
- >
- > : I'm a bit new at this too, but I think this will work.
- >
- > If you have to use phrases like "I think it will work" or "I'm not sure"
- > in your posting, please don't post it. There are enough folks around
- > here who know for sure - especially in elementary cases like this one.
- >
- > - Jochen
- >
- > --
- Perhaps... Jochen it would also help if you posted the answers???
-
- Just trying to help...
- H
-